package com.huatai.datacenter.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.huatai.datacenter.entity.datamodel.DataModelBaseEntity;
import com.huatai.datacenter.entity.datamodel.DataModelFieldEntity;
import com.huatai.datacenter.mapper.DataModelFieldMapper;
import com.huatai.datacenter.service.DataModelFieldService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author gusiyi
 * @version 1.0
 * @className DataModelFieldServiceImpl
 * @description 描述：
 * @date 2023/5/26 9:42
 */
@Service
public class DataModelFieldServiceImpl extends ServiceImpl<DataModelFieldMapper,DataModelFieldEntity> implements DataModelFieldService {

	@Override
	public List<DataModelFieldEntity> getDataModelFieldList(Long dataModelId) {
		LambdaQueryWrapper<DataModelFieldEntity> fieldQuery = Wrappers.lambdaQuery();
		fieldQuery
			.eq(DataModelBaseEntity::getDeleted,false)
			.eq(DataModelFieldEntity::getDataModelId,dataModelId)
			.orderByAsc(DataModelFieldEntity::getCreateTime);
		return list(fieldQuery);
	}

}
